import { _decorator, AudioClip, AudioSource, Component, Input, input, KeyCode, Node, resources, UITransform, Vec3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('audio')
export class audio extends Component {
    @property(AudioClip)
    public clip: AudioClip = null!;   

    @property(AudioSource)
    public audioSource: AudioSource = null!;
   
    start() {
        if(this.clip){
            this.audioSource.clip = this.clip
            this.audioSource.play()
        }
  
        // let player:AudioSource = this.getComponent(AudioSource);
        // resources.load("wuxiansu",AudioClip,(err,clip:AudioClip)=>{
        //     // player.clip = clip;
        //     // player.play();
            
        // });
   
    }

    update(deltaTime: number) {
        
    }
}


